;;;
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	All rights reserved.
;;;
;;;	Copyright:  
;;;	   Edited:
(defun c:imgclip ()
  (setq arccen (upoint 1 "" "Center of image clip arc" (if arccen arccen nil) (if arccen_bpt arccen_bpt nil)))
  (setq arcirad (ureal 1 "" "Inside radius of image clip arc" (if arcirad arcirad nil)))
  (setq arcorad (ureal 1 "" "Outside radius of image clip arc" (if arcorad arcorad nil)))
  (setq angstart (uangle 1 "" "Starting angle (CCW)" nil (if arccen arccen nil)))
  (setq angend (uangle 1 "" "Ending angle (CCW)" nil (if arccen arccen nil)))
  (if (<= angend angstart) (setq angend (+ angend PI PI)))
  (princ (strcat "\nSweep angle of image clip arc is " (rtos (* 180.0 (/ (- angend angstart) PI))2 2)(chr 176)"\n"))
  (setq angdiv (uint 1 "" "number of image clipping points along this arc" (if angdiv angdiv nil)))
  (setq angincr (/(- angend angstart) angdiv))
  (setq interang angstart)
  (setq clip_lst nil)
  (setq clip_lst (list (polar arccen interang arcorad)))
  (while (< (+ interang angincr) angend)
    (setq clip_lst (append clip_lst (list (polar arccen (+ interang angincr) arcorad))))
    (setq interang (+ interang angincr))
  )
  (setq clip_lst (append clip_lst (list (polar arccen angend arcorad))))
  (setq interang angend)
  (setq clip_lst (append clip_lst (list (polar arccen interang arcirad))))
  (while (> (- interang angincr) angstart)
    (setq clip_lst (append clip_lst (list (polar arccen (- interang angincr) arcirad))))
    (setq interang (- interang angincr))
  )
  (setq clip_lst (append clip_lst (list (polar arccen angstart arcirad))))
  (foreach n clip_lst (setq ptstr (append ptstr (list (strcat(rtos(car n)2 4)","(rtos(cadr n)2 4)" ")))))
  (command "image" "attach" "1x1" arccen arcorad 0 )
  (command ".imageclip" (entlast) "N" "P" ptstr)
  (command "")
  (princ)
)
